using System;
using System.Windows.Forms;

using FreeFlow.Administration;

namespace FreeFlowAdministrator
{
	/// <summary>
	/// Summary description for AdminFormsAdaptor.
	/// </summary>
	public class AdminFormsAdaptor : Adaptor
	{
    private ActionCollection actions;
    public AdminFormsAdaptor(ActionCollection actions)
    {
      this.actions = actions;
    }

    public override void AddChildren(TreeNode node)
    {
      foreach (Action action in actions)
      {
        TreeNode childNode = TreeNodeFactory.CreateTreeNode(new AdminFormAdaptor(action));
        node.Nodes.Add(childNode);
      }
    }

    public override int ImageIndex
    {
      get
      {
        return 4;
      }
    }

    public override string Text
    {
      get
      {
        return "Forms (" + actions.Count + ")";
      }
    }

    public override object Object
    {
      get
      {
        return actions;
      }
    }
	}
}
